package com.haibara.codesubmiteval.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.haibara.codesubmiteval.model.dto.user.UserAddRequest;
import com.haibara.codesubmiteval.model.dto.user.UserChangePasswordRequest;
import com.haibara.codesubmiteval.model.dto.user.UserQueryRequest;
import com.haibara.codesubmiteval.model.dto.user.UserUpdateRequest;
import com.haibara.codesubmiteval.model.entity.User;
import com.haibara.codesubmiteval.model.vo.LoginUserVO;
import com.haibara.codesubmiteval.model.vo.Top10VO;
import com.haibara.codesubmiteval.model.vo.TotalInfo;
import com.haibara.codesubmiteval.model.vo.UserAcceptedQuestionVO;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.NotNull;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Set;

/**
 * 用户服务
 */
public interface UserService extends IService<User> {


    /**
     * 用户登录
     *
     * @return 脱敏后的用户信息
     */
    LoginUserVO userLogin(Long id, String password, HttpServletRequest request, HttpServletResponse response);

    /**
     * 获取当前登录用户
     *
     * @param request
     * @return
     */
    User getLoginUser(HttpServletRequest request);

    /**
     * 用户注销
     *
     * @param request
     * @return
     */
    boolean userLogout(HttpServletRequest request);

    /**
     * 分页查询模糊用户
     *
     * @param userQueryRequest
     * @return
     */
    Page<User> pageQueryUser(UserQueryRequest userQueryRequest);

    Long addUser(UserAddRequest userAddRequest);

    void updateUser(UserUpdateRequest userUpdateRequest);

    Integer addUserByFile(MultipartFile file);

    UserAcceptedQuestionVO getUserCompletionOfTheQuestion(Long userId);

    List<Top10VO> getTop10Ranking();

    Top10VO getMyRank(Long userId);

    void changePassword(UserChangePasswordRequest userChangePasswordRequest);

    TotalInfo getTotalInfo();

    List<Long> getMyAcceptedQuestion(Long userId);

    void deleteUser(Long id);
}
